

#define VALUE_LEN 512  //每包长度

typedef enum 
{
      FID_picture=1,
      //FID_data, 
      //FID_end,//以上三个为图片和文件流传输时使用的保留
      FID_left_clif=4,//4
      FID_right_clif
}FID_NAME;

typedef enum 
{
      Ftype_stream=1,
      Ftype_char=1,
      Ftype_short, 
      Ftype_int,
      Ftype_float//4
}FID_TYPE;

typedef enum  
{
      PICTSTREAM=1, DATASTREAM, FILESTREAM
}CHANNEL_TYPE;

typedef struct 
{     CHANNEL_TYPE channel;
      FID_NAME  name_fid;
      FID_TYPE type;
}adebug_param_table;









//#define DATASTREAM 0x01

extern const  adebug_param_table param_table[];
extern int crc16_table[256];


int cal_crc16(char *data, int len);
void build_crc16_table(void);

char pack_prease_send(char *data, int len, int frame_numb, CHANNEL_TYPE channel, FID_TYPE type);

char send_pack_data(char *source, int lenth,FID_NAME fid_name);
char handle_stream_data(char *data, int len,int frame_numb,char channel);

char handle_common_data(char *data, int len,int frame_numb,char channel);
